<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>标题</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="/lib/layui/css/layui.css">
    <link rel="stylesheet" href="/static/css/weadmin.css">
    <!-- 注意：如果你直接复制所有代码到本地，上述css路径需要改成你本地的 -->
</head>
<body>
<form class="layui-form searchForm">
    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">姓名:</label>
            <div class="layui-input-inline">
                <input type="text" name="realName" id="realName" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label">身份证号:</label>
            <div class="layui-input-inline">
                <input type="text" name="userCard" id="userCard" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-inline" style="left:-20px;">
            <label class="layui-form-label">证书编号:</label>
            <div class="layui-input-inline">
                <input type="text" name="aptitudeNumber" id="aptitudeNumber" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-inline">
            <div class="layui-input-inline">
                <button class="layui-btn" lay-submit lay-filter="formDemo">查询</button>
                <button class="layui-btn" lay-submit>清空</button>
            </div>
        </div>
    </div>
</form>
<table class="layui-hide" id="dataList" lay-filter="dataList"></table>
<script type="text/html" id="barDemo">
    <a class="layui-btn layui-btn-xs" lay-event="detail">查看</a>
</script>

<script type="text/javascript" src="/lib/layui/layui.js"></script>
<script src="/static/js/main.js"></script>
<script>
    layui.use(['jquery', 'configureCom', 'configure', 'table', 'sessionFun'], function () {
        var $ = layui.jquery;
        var configure = layui.configure;
        var matchDict = layui.matchDict;
        var table = layui.table;
        var sessionFun = layui.sessionFun;
        var configureCom = layui.configureCom;

        var cols = [[
            {
                field: 'realName', title: '姓名'
            }, {
                field: 'userCard', title: '身份证号'
            },
            {
                field: 'registerType', title: '证书类别', templet: function (d) {
                    return '<p>' + matchDict.name(d.registerType, configure.CERT_TYPE_CODE) + '</p>';
                }
            },
            {
                field: 'aptitudeNumber', title: '证书编号'
            },
            {
                field: 'aptitudeOrg', title: '发证机关', templet: function (d) {
                    return '<p>' + d.aptitudeOrg + '</p><p>发证日期:' + (d.grantTime || '-') + '</p>';
                }
            },
            {title: '操作', toolbar: '#barDemo', width: 150}
        ]];

        configureCom.tableRender(configure.ORG_ZIZHI_CERT_LIST, {aptitudeStatus: 3}, cols, 'dataList', 10, '', 'toolbarOrg');
        configureCom.tableSearch(true);
        //每行操作
        table.on('tool(dataList)', function (obj) {
            var data = obj.data;
            sessionFun.set(configure.SESSION_ZIZHI_USER_LIST_DATA, data);
            if (obj.event === 'detail') {
                top.layer.open({
                    type: 2,
                    title: data.realName + '个人信息',
                    area: configureCom.Psize1,
                    content: configure.ORG_USER_ZIZHI_DETAIL_HTML
                });
            }
        });

        function changePass(orgNo, url) {
            configureCom.postDataAjax(url, {userAptitudeId: orgNo}).then(function (res) {
                if (res.code == 0) {
                    top.layer.msg('设置成功！');
                    configureCom.tableReload(true);
                } else {
                    top.layer.alert('设置失败！')
                }
            });
        }
    });

</script>
</body>
</html>